package com.gzz.demo.multithread.thread;

public class DaemonTest {
	public void testThread(final boolean daemon) {  
        final Thread t = new Thread() {  
            public void run() {  
                try {  
                    Thread.sleep(10000);  
                    new ChildThread(Thread.currentThread()).start();  
                    System.out.println("daemon? " + daemon);  
                } catch (InterruptedException e) {  
                    e.printStackTrace();  
                }  
            }  
        };  
        t.setDaemon(daemon);  
        t.start();  
    }  
  
    public static void main(String[] args) {  
        DaemonTest test = new DaemonTest();  
        test.testThread(false);  
//        test.testThread(true);  
        System.out.println("last command");  
    }  
}
